package com.k.base.jdk.functions.demo6;

import com.k.base.jdk.functions.demo5.model.Fei;
import com.k.base.jdk.functions.demo5.model.Gan;
import com.k.base.jdk.functions.demo5.model.Heart;

import java.util.function.Consumer;

public class PersonSimple extends AbstractPerson {
    private final Heart heart;
    private final Gan gan;
    private final Fei fei;

    private PersonSimple(){
        heart = new Heart();
        gan = new Gan();
        fei = new Fei();
    }

    public PersonSimple setHeart(Consumer<Heart> c) {
        c.accept(this.heart);
        return this;
    }
    public PersonSimple setGan(Consumer<Gan> c) {
        c.accept(this.gan);
        return this;
    }
    public PersonSimple setFei(Consumer<Fei> c) {
        c.accept(this.fei);
        return this;
    }

    @Override
    public Heart getHeart() {
        return heart;
    }

    @Override
    public Gan getGan() {
        return gan;
    }

    @Override
    public Fei getFei() {
        return fei;
    }

    public static PersonSimple create(){
        return new PersonSimple();
    }
}
